<?php

function getCateName($cateid){
	$cateid = getNoiseCid($cateid);
	$myFile  =  file("./includes/catedata.inc.php");

	$allnum=count($myFile); 
	for ($i=1;$i<$allnum;$i++){
		$m=explode(",",$myFile[$i]);
		$xiabiao=trim($m[0]);
		$name[$xiabiao]=$m[2];
		$cat[$xiabiao][1]=$m[3];
		$cat[$xiabiao][2]=$m[4];

	}

	$k[0]=$cat[$cateid][0];
	$k[1]=$cat[$cateid][1];
	$k[2]=$cat[$cateid][2];


	$n_id  =explode(" ",$k[1]);
	$n_name=explode(" &gt; ",$k[2]);


	for ($i=0;$i<count($n_id);$i++){
		if ($name[$n_id[$i]]=="null"){
			//do nothing
		}else{
			$listsort.=  "<a href=".SITEPATH."index.php/List/cid/".addNoise($d,$n_id[$i]).">".$name[$n_id[$i]]."</a> &gt; ";
			$listtitle.= $name[$n_id[$i]]."-";
		}
	}

	for ($i=1;$i<$allnum;$i++){
		$m=explode(",",$myFile[$i]);
		if ($cateid==$m[1]) {
			$listss.= "<li><a href=\"".SITEPATH."index.php/List/cid/".addNoise($d,$m[0])."".$no1keyword.$no1mid."\">".$m[2]."</a></li>";
			$listkey.= $m[2].",";

		}
	}
	$urls = array();
	$urls['listtitle'] = substr($listtitle,1);
	$urls['nav'] = $listsort;
	$urls['lists'] = $listss;
	return $urls;

}

?>